<?php

namespace app\common\model;

use think\Model;
/**
 * 用户表模型
 * @package app\common\model
 */
class User extends Model
{
    // 定义时间戳字段名
    protected $createTime = 'ctime';
    protected $updateTime = 'mtime';

    // 自动写入时间戳
    protected $autoWriteTimestamp = true;

    public function getInfo($account)
    {
        $fields = 'username,mobile,last_login_ip,last_login_time,nick,status,token,ctime,mtime,id,portrait';
        $where['username|mobile'] =  $account;
        return self::where($where)->field($fields)->find()->toArray();
    }
}
